home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
util
/
cli
/
FWB10.lha
/
FWB.doc
< prev
Wrap
Text File
|
1980-01-13
|
3KB
|
105 lines
**************************************************************************
FastestWaitBlit 1.0 by Olly koenders - Australia 07-09-97
I'm often pushed to ponder, just what sort of "programmers" we have
buggerisin' around with our OS. These are a few example codes I pulled out
of various patches claiming to "speed up" simple WaitBlit()!
...First - the standard routine for OS 3.0:
tst.b $dff002 ;unnecessary, really
btst #6,$dff002 ;test if blitter busy
bne.b _one ;if yes - then branch
rts ;otherwise out
_one:
tst.b $bfe001 ;whaaaat?
tst.b $bfe001 ;ditto..!
btst #6,$dff002 ;blitter busy?
bne.b _one ;yes? - then wait some more
tst.b $dff002 ;otherwise... [what the..?]
rts ;and quit (finally!)
COMMENT: [Gawd!] Makes ya wonder what the REST of the
OS looks like eh? [shudder!]
...Let's try FastWaitBlit 2.5 ~1996:
tst.b $dff002 ;what for?
btst #6,$dff002 ;blitter busy?
beq.s _out ;if not - bye
move.l a0,-(sp) ;save a0
lea $dff002,a0 ;reason for saving a0
tst.b (a0) ;useless, trying to do register indirect
_one:
btst #6,(a0) ;blitter busy?
bne.s _one ;if so - branch
move.l (sp)+,a0 ;restore a0
_out:
rts ;run away!
COMMENT: Don't really know WHY he's using register indirect for this, his
docs say that it's faster and of course it is, but when the
blitter's ready it's ready, and you're not gonna hurry it along
by checking it faster, and you LOSE speed by stacking and
unstacking [sigh :)]
...Now Apatch (beta) 20-03-97:
btst #6,$dff002 ;blitter busy?
beq.b _out ;if not - then bye
_one:
btst #6,$dff002 ;else check again
bne.b _one ;if busy then branch
_out:
rts ;bye
COMMENT: Gettin' better, but why waste the space doin' it twice?
...I meself could suggest:
_one:
btst #6,$dff002 ;blitter busy?
bne.b _one ;if so - wait some more
rts ;done
...Or, we could give the blitter a push to speed it up while we wait:
move.w #$8400,$dff096 ;switch on BLITHOG
_one:
btst #6,$dff002 ;blitter busy?
bne.b _one ;if so - wait some more
move.w #$400,$dff096 ;kill BLITHOG
rts ;seeya later
COMMENT: Now what's so damn hard about that?
More flames if and when I find 'em. If anyone wants ta comment, feel free
an' don't hold back :)
FastestWaitBlit gives the blitter a push and therefore should be faster
than all the rest. Works on all Amigas, Kickstart versions and processors.
Just call it from the CLI/Shell as FWB. The new code will be patched and
FWB will quit - unlike some other patches that require "Run" or "Runback"!
Ensure that you have some fastram for it to run in, otherwise it'll be
slower than the original ROM routine as the ROM is accessed at lower
waitstates than chipram. Anyhoo - enjoy :)
Olly.
Co-Nutcase A.R.G. BBS [Amiga Resource Group] +61-3-9870-4608 Land of Oz